import "./basePage.scss"
import React, { Component } from 'react'
import { HashRouter as Hash, Switch, Route, Redirect } from 'react-router-dom'
import lazyLoad from "../utils/lazyLoad"
export default class BasePage extends Component {
    render() {
        return (
            <Hash>
                <MainRouter />
            </Hash>
        )
    }
}


class MainRouter extends Component {
    render() {
        return (
            <Switch style={{ width: "100%", height: "100%" }}>
                <Route path="/" exact render={() => <Redirect to="/login" />} />
                <Route path="/login" component={lazyLoad(() => import("./login/login"))} />
                <Route path="/main" component={lazyLoad(() => import("./main"))} />
                <Route path="/404" component={lazyLoad(() => import("./errorPage/404"))} />
                <Route path="/503" component={lazyLoad(() => import("./errorPage/503"))} />
                <Route path="*" render={() => <Redirect to="/404" />} />
            </Switch>
        )
    }
}